#ifndef COMPONENT_TABLE_H
#define COMPONENT_TABLE_H

#include "component.h"
#include "graphics.h"
#include <QTableWidget>

class ComponentTable : public QTableWidget
{
  Q_OBJECT

public:
  ComponentTable(QWidget* parent = 0);

  void addComponents(const ComponentMap& components, const GraphicsMap& graphics);

  Component component(unsigned int row) const;
  Component component(const QString& componentName) const;
  QPixmap pixmap(const QString& componentName) const;

protected:
  void mousePressEvent(QMouseEvent *event);

private:
  ComponentMap mComponents;
  GraphicsMap mGraphics;
};

#endif
